<template>
	<el-dialog :visible="show" @close="$emit('close')" width="400px" title="上传完成后请关闭该对话框">
		<el-upload
			class="upload-demo"
			action="/api/admin/market/edit-worker/import-excel/"
			:multiple="false"
			name="xl"
			:limit="1"
			:headers="headers"
			:on-success="onSucc"
			accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
			:file-list="fileList"
		>
			<el-button size="small" type="primary">点击上传</el-button>
		</el-upload>
	</el-dialog>
</template>
<script>
export default {
	data() {
		return {
			fileList: [],
			headers: {
				Authorization: 'Bearer ' + sessionStorage.getItem('token')
			}
		}
	},
	props: {
		show: {
			default: false,
			type: Boolean
		}
	},
	methods: {
		onSucc() {
			// this.$emit('close')
		}
	}
}
</script>
